package com.tm.d9_generics;

import com.tm.d21_interface.C;

import java.util.ArrayList;

/**
 * 2024/5/22 泛型 Cjj 15:40
 */
public class Test {
    public static void main(String[] args) {
        //目标：认识泛型
         ArrayList list = new ArrayList<>();
         list.add("java");
        for (int i = 0; i < list.size(); i++) {
              String e=(String) list.get(i);
              System.out.println(e);
        }
         System.out.println("----------------");
        ArrayList<String> list1 = new ArrayList<>();
        list1.add("java1");
        list1.add("java2");


        for (int i = 0; i < list1.size(); i++) {
              String e=list1.get(i);
              System.out.println(e);
        }
    }
}
